package com.ryskoo.catering.ordermain.repository;

import com.ryskoo.catering.ordermain.domain.OrderMainPO;
import com.ryskoo.common.dto.customer.VendorIndexInfo;
import com.ryskoo.framework.core.repository.IBasicRepository;

import java.util.List;

/**
 * @author BeHappy
 */
public interface IOrderMainRepository extends IBasicRepository<OrderMainPO> {

    /**
     * 根据订单编号获取订单
     * @param orderId
     * @return
     */
    OrderMainPO getByOrderId(String orderId);

    /**
     * 根据商户查询当天的订单数量
     * @param date yyyy-MM-dd
     * @param vendorUuid
     * @return
     */
    int getOrderCountByDate(String date,String vendorUuid);

    /**
     * 根据商户查询当天的订单付款总金额
     * @param date yyyy-MM-dd
     * @param vendorUuid
     * @return
     */
    double getOrderAmtByDate(String date,String vendorUuid);

    VendorIndexInfo getDailyVendorIndexInfo(String vendorUuid, String date);
    /**
     * 查询商品月销数量
     *
     * @param products
     * @return
     */
    List<Object[]> getMonthSellNum(List<String> products, String todayDateStr, String monthBeforeDateStr);

    /**
     * 查询1个月内商户月销商品数量
     *
     * @param vendorUuid
     * @return
     */
    int getMonthSellProductNum(String vendorUuid, String todayDateStr, String monthBeforeDateStr);

}
